home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / Bowers Development / AppMaker 2.0b5 / Examples / TCL / AMReminder / zMainWindow.cp < prev    next >
Text File  |  1996-03-19  |  4KB  |  147 lines

  1. /* zMainWindow.cp -- window methods */
  2. /* Created 01/01/95 12:01 PM by AppMaker */
  3.  
  4. /*    We recommend that you not modify this module and instead modify        */
  5. /*    its subclass, MainWindow.  The 'z' prefix on this module marks        */
  6. /*    a module which is likely to be regenerated by AppMaker after you    */
  7. /*    make changes to the user interface.  The modules without the 'z'    */
  8. /*    prefix will not be regenerated by AppMaker unless you delete them.    */
  9. /*    Using a separate subclass to override the AppMaker-generated code    */
  10. /*    lets you regenerate code without losing your hand-coded changes.    */ 
  11.  
  12. #include <Commands.h>
  13. #include <Constants.h>
  14. #include <Global.h>
  15. #include <CBartender.h>
  16. #include <CDecorator.h>
  17. #include <CDesktop.h>
  18. #include <CDirector.h>
  19. #include <CError.h>
  20. #include <CSizeBox.h>
  21. #include <TBUtilities.h>
  22. #include <CPicture.h>
  23. #include <CAMStaticText.h>
  24. #include <CAMBorder.h>
  25. #include <CScrollPane.h>
  26. #include <CAMArrayPane.h>
  27. #include <CAMButton.h>
  28. #include "CmdCodes.h"
  29. #include "Add.h"
  30. #include "Add.h"
  31. #include "AMReminderData.h"
  32. #include "zMainWindow.h"
  33.  
  34. #define    MainWindowID    1000        /* resource ID for WIND template */
  35.  
  36. extern    CBartender        *gBartender;    /* The menu handling object */
  37. extern    CDecorator        *gDecorator;    /* Window dressing object    */
  38. extern    CDesktop        *gDesktop;        /* The enclosure for all windows */
  39. extern    CError            *gError;        /* The error handling object */
  40.  
  41. /*----------*/
  42. void    ZMainWindow::IZMainWindow    (CDirector            *aSupervisor)
  43. {
  44.     CView            *enclosure;
  45.     CBureaucrat        *supervisor;
  46.     CSizeBox        *aSizeBox;
  47.  
  48.     IWindow (MainWindowID, FALSE, gDesktop, aSupervisor);
  49.  
  50.     enclosure = this;
  51.     supervisor = this;
  52.  
  53.         itsLogoPict = new CPicture;
  54.         itsLogoPict->IViewRes ('PctP', 1000, enclosure, supervisor);
  55.  
  56.         itsYearLabel = new CAMStaticText;
  57.         itsYearLabel->IViewRes ('AETx', 1001, enclosure, supervisor);
  58.  
  59.         itsRemindersLabelLabel = new CAMStaticText;
  60.         itsRemindersLabelLabel->IViewRes ('AETx', 1002, enclosure, supervisor);
  61.  
  62.         itsRemindersBorder = new CAMBorder;
  63.         itsRemindersBorder->IViewRes ('Bord', 1003, enclosure, supervisor);
  64.         itsRemindersScroller = new CScrollPane;
  65.         itsRemindersScroller->IViewRes ('ScPn', 1004, itsRemindersBorder, supervisor);
  66.             itsReminders = NewReminders ();
  67.             itsReminders->IViewRes ('ATbl', 1005, itsRemindersScroller, supervisor);
  68.         itsRemindersScroller->InstallPanorama (itsReminders);
  69.  
  70.         itsAddButton = new CAMButton;
  71.         itsAddButton->IViewRes ('CtlP', 1006, enclosure, supervisor);
  72.  
  73.         itsEditButton = new CAMButton;
  74.         itsEditButton->IViewRes ('CtlP', 1007, enclosure, supervisor);
  75.  
  76.         itsDeleteButton = new CAMButton;
  77.         itsDeleteButton->IViewRes ('CtlP', 1008, enclosure, supervisor);
  78.  
  79.     itsMainPane = NULL;
  80.     } /* IZMainWindow */
  81.  
  82.     /*----------*/
  83.     // The only purpose of this function is so that you can override it
  84.     // to create the list as your subclass of CAMArrayPane
  85.  
  86.     CAMArrayPane    *ZMainWindow::NewReminders    (void)
  87.     {
  88.         CAMArrayPane        *theList;
  89.  
  90.         theList = new CAMArrayPane;
  91.  
  92.         return (theList);
  93.  
  94.     } /* NewReminders */
  95.  
  96.     /*----------*/
  97.     void    ZMainWindow::UpdateMenus    (void)
  98.     {
  99.     inherited::UpdateMenus ();
  100.  
  101.     gBartender->EnableCmd (cmdAddReminder);
  102.     gBartender->EnableCmd (cmdEditReminder);
  103.     gBartender->EnableCmd (cmdDeleteReminder);
  104.  
  105. } /* UpdateMenus */
  106.  
  107. /*----------*/
  108. void    ZMainWindow::DoCommand        (long        theCommand)
  109. {
  110.     switch (theCommand) {
  111.  
  112.     case cmdAddReminder:
  113.         DoAddReminder ();
  114.         break;
  115.  
  116.     case cmdEditReminder:
  117.         DoEditReminder ();
  118.         break;
  119.  
  120.     case cmdDeleteReminder:
  121.         DoDeleteReminder ();
  122.         break;
  123.  
  124.     default:
  125.         inherited::DoCommand (theCommand);
  126.         break;
  127.     } /* switch */
  128.  
  129. } /* DoCommand */
  130.  
  131. //----------
  132. void    ZMainWindow::DoAddReminder ()
  133. {
  134. }
  135.  
  136. //----------
  137. void    ZMainWindow::DoEditReminder ()
  138. {
  139. }
  140.  
  141. //----------
  142. void    ZMainWindow::DoDeleteReminder ()
  143. {
  144. }
  145.  
  146. /* zMainWindow.cp */
  147.